function formatDateTime (date) {
    let y = date.getFullYear()
    let m = date.getMonth() + 1
    m = m < 10 ? ('0' + m) : m
    let d = date.getDate()
    d = d < 10 ? ('0' + d) : d
    let h = date.getHours()
    h=h < 10 ? ('0' + h) : h
    let minute = date.getMinutes()
    minute = minute < 10 ? ('0' + minute) : minute
    let second=date.getSeconds()
    second=second < 10 ? ('0' + second) : second
    return y + '/' + m + '/' + d+' '+h+':'+minute
 
    }

// 格式化任务中的时间
function formatTimeTask(array){
    array.forEach((value,index)=>{
        const start_obj = new Date(value.startTime)
        const end_obj = new Date(value.endTime)
        value.startTime = formatDateTime(start_obj)
        value.endTime = formatDateTime(end_obj)
    
    })

}

module.exports={
    formatTimeTask:formatTimeTask,
    formatDateTime:formatDateTime

}